package br.com.ep.generico.core;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.transaction.annotation.Transactional;

import antlr.collections.List;

public class GenericDao<T> extends HibernateDaoSupport {

	
	
	
	public GenericDao() {
		super();
	}

	@Transactional
	public T save(T entity){		
		entity = getHibernateTemplate().merge(entity);
		
		return entity;
	}

	@Transactional
	public void delete(T entity){		
		getHibernateTemplate().delete(entity);		
	}
	

	@Transactional(readOnly=true)
	public List findAll(){
		
		//return this.getHibernateTemplate().loadAll(this.getClass());
		
		return null;
	}
	
	@Transactional(readOnly=true)
	public List dinamicSearch(){
		return null;
	}

	
}
